package com.qianmang.damawangticket.service;

import android.accessibilityservice.AccessibilityService;
import android.content.Intent;
import android.os.Handler;
import android.os.Looper;
import android.text.TextUtils;
import android.util.Log;
import android.view.accessibility.AccessibilityEvent;

import com.qianmang.damawangticket.present.DaMaiPresent;


public class MyAccessibilityService extends AccessibilityService {
    private static final String TAG = "MyAccessibilityService";

    private DaMaiPresent mDaMaiPresent;

    private Handler handler = new Handler(Looper.getMainLooper());

    @Override
    public void onCreate() {
        super.onCreate();
    }

    @Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
        CharSequence className = event.getClassName();
        Log.i(TAG, "event >> TYPE:" + event.getEventType());
        Log.i(TAG, "event >> ClassName:" + className);
        if(mDaMaiPresent == null){
            mDaMaiPresent = new DaMaiPresent(this, handler);
        }
        mDaMaiPresent.startExe(event);

    }

    @Override
    public void onInterrupt() {

    }
}
